<?php
require_once "lib/Client.php";
$config = array();
$config['base_uri'] = 'http://oauth2_client/';
$config['client_secret'] = '6c89f78002769622678419d53eb05724';
//$config['code'] = 'b521de3b22e711096c7b78c40702c541';
$config['client_id'] = '3334';
$config['authorize_uri'] = 'http://oauth2_server/mongo/authorize.php';
$config['access_token_uri'] = 'http://oauth2_server/mongo/token.php';
$config['services_uri'] = 'http://oauth2_server/mongo/';
$config['expires_in'] = '13600';
$config['cookie_support'] = true;
$client = new OAuth2Client($config);

$session = $client->getSession();
$token = $client->getAccessToken();
var_dump($token, $_REQUEST);
$me = $client->api('/protected_resource.php' , 'GET', array('oauth_token' => $token));
var_dump($me);

